const mongoose = require('mongoose'),
    DB_URL = 'mongodb://localhost:27017/sms';
    // DB_URL = 'mongodb://localhost:27017/machine';

mongoose.connect(DB_URL, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, user: 'qxfront', pass: 'xDFaXEsV7CBgmo7Rs9mK' });
// mongoose.connect(DB_URL, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true });

mongoose.connection.on('connected', function () {
    console.log('mongodb ok');
});


mongoose.connection.on('error', function (err) {
    console.log('mongodb err: ' + err);
});


mongoose.connection.on('disconnected', function () {
    console.log('mongodb down');
});    
